"""Pretty futile.
"""
import pygame

from main import main

class Debug:
    def __init__(self):
        self.active = False
    
    def update(self):
        if main.key.checkPressed(pygame.K_F12):
            self.active = not self.active
            if self.active:
                main.fpsCap = 12
                main.drawList.append(self)
            else:
                main.fpsCap = 60
                main.drawList.remove(self)
        
        if self.active:
            #print stuff
            pass
    
    def on_draw(self, surface):
        #Widget boundaries
        for widget in main.interface.widgets:
            pygame.draw.rect(surface, (255,0,0), widget.rect, 1)
        
        #Line AABB
        for line in main.world.lines:
            pygame.draw.rect(surface, (255,0,0), line.AABB, 1)